//
//  LllegalTableViewCell.m
//  BusinessApp
//
//  Created by macox on 16/9/27.
//  Copyright © 2016年 macox. All rights reserved.
//

#import "LllegalTableViewCell.h"

@implementation LllegalTableViewCell
- (IBAction)editBtn:(UIButton *)sender {
    [self.delegate trunEditLllegalVC:_productID :_MinSalePriceString :_MaeketPriceString :_StockString];
}
- (void)setMyModel:(ProductSaleStatusModel *)myModel{
    _ProductName.text = myModel.ProductName;
        NSString *string = [NSString stringWithFormat:@"%@%@",ReleaseORDebug,myModel.ImagePath];
        NSURL *URL = [NSURL URLWithString:string];
//        [_ProductImageV sd_setImageWithURL:URL];
    [_ProductImageV sd_setImageWithURL:URL placeholderImage:[UIImage imageNamed:@"占位图3.png"]];
    
    _ReasonLabel.text = myModel.AuditReason;
    if ([myModel.MinSalePrice isEqual:myModel.MarketPrice]) {
        _MarkPrice.textColor = [UIColor whiteColor];
        _LineView.backgroundColor = [UIColor whiteColor];
    } else{
        _MarkPrice.textColor = [UIColor grayColor];
        _LineView.backgroundColor = [UIColor grayColor];
    }
    _MinSalePrice.text = [NSString stringWithFormat:@"¥%.2f",myModel.MinSalePrice.doubleValue] ;
    _MarkPrice.text = [NSString stringWithFormat:@"%.2f",myModel.MarketPrice.doubleValue];
    _Stock.text = [NSString stringWithFormat:@"库存 %@",myModel.Stock];
    _TimeLabel.text = myModel.AddedDate;
    _productID = [NSString stringWithFormat:@"%d",myModel.Id];
    _MinSalePriceString = [NSString stringWithFormat:@"%.2f",myModel.MinSalePrice.doubleValue];
    
    _MaeketPriceString = [NSString stringWithFormat:@"%.2f",myModel.MarketPrice.doubleValue];
    _StockString =  [NSString stringWithFormat:@"%@",myModel.Stock];
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    _EditBtn.layer.borderWidth = 0.5f;
    
    _EditBtn.layer.borderColor = [[UIColor grayColor]CGColor];
    
    
    _DelectBtn.layer.borderWidth = 0.5f;
    
    _DelectBtn.layer.borderColor = [[UIColor grayColor]CGColor];
    

    // Initialization code
}
- (IBAction)DelectBtnAction:(UIButton *)sender {
    
    [self.delegate delectLllegalVC:_productID];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
